package com.diancan.modules.admin.restaurant;

import com.diancan.common.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("restaurant")
public class RestaurantController {
    private final RestaurantService restaurantService;

    public RestaurantController(RestaurantService restaurantService) {
        this.restaurantService = restaurantService;
    }

    /**
     * 获取餐馆信息
     *
     * @return
     */
    @GetMapping("get")
    public Result getRestaurant() {
        return Result.buildSuccessResult(restaurantService.list().get(0));
    }
}
